#include <stdio.h>
#include <stdlib.h>
#include "platform.h"

unsigned revn(unsigned u,int n)
{
        unsigned v = 0;
        for(;n>0;n--)
            {
                v = (v<<1)|(u&0x01);
                u = (u>>1);
            }
        return v;
}

#ifdef __MAIN__
int main(void)
{
    printf("30 rev:%d\n",revn(0x30,8));

    return 1;
}
#endif
